Open Traffic Generator API (1.28.0)

Download OpenAPI specification:Download

Open Traffic Generator API defines a model-driven, vendor-neutral and standard interface for emulating layer 2-7 network devices and generating test traffic.

Contributions can be made in the following ways:

Configuration

set_config

Sets configuration resources on the traffic generator.

Request Body schema: application/json
Array of objects (Port)

The ports that will be configured on the traffic generator.

Array of objects (Lag)

The LAGs that will be configured on the traffic generator.

Array of objects (Layer1)

The layer1 settings that will be configured on the traffic generator. Since layer1 settings usually vary across variety of test ports, these most likely won't be portable.

Array of objects (Capture)

The capture settings that will be configured on the traffic generator.

Array of objects (Device)

The emulated devices that will be configured on the traffic generator. Each device contains configurations for network interfaces and protocols running on top of those interfaces.

Array of objects (Flow)

The flows that will be configured on the traffic generator.

object (Event)

Under Review: Event configuration is currently under review for pending exploration on use cases.

The optional container for event configuration. Both cp_events.enable and dp_events.enable must be explicitly set to true to get control_plane_data_plane_convergence_us metric values for convergence metrics.

object (Config.Options)

Global configuration options.

Array of objects (Lldp)

LLDP protocol that will be configured on traffic generator.

Responses

Request samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    },
  • "lldp": [
    ]
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

get_config

Responses

Response samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    },
  • "lldp": [
    ]
}

update_config

Updates specific attributes of resources configured on the traffic generator. The fetched configuration shall reflect the updates applied successfully. The Response.Warnings in the Success response is available for implementers to disclose additional information about a state change including any implicit changes that are outside the scope of the state change.

Request Body schema: application/json
choice
string
Value: "flows"
object (Flows.Update)

A container of flows with associated properties to be updated without affecting the flows current transmit state.

Responses

Request samples

Content type
application/json
{
  • "choice": "flows",
  • "flows": {
    }
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

Control

set_control_state

Sets the operational state of configured resources.

Request Body schema: application/json
choice
required
string
Enum: "port" "protocol" "traffic"
object (State.Port)

States associated with configured ports.

object (State.Protocol)

States associated with protocols on configured resources.

object (State.Traffic)

States associated with configured flows

Responses

Request samples

Content type
application/json
{
  • "choice": "port",
  • "port": {
    },
  • "protocol": {
    },
  • "traffic": {
    }
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

set_control_action

Triggers actions against configured resources.

Request Body schema: application/json
choice
required
string
Value: "protocol"
object (Action.Protocol)

Actions associated with protocols on configured resources.

Responses

Request samples

Content type
application/json
{
  • "choice": "protocol",
  • "protocol": {
    }
}

Response samples

Content type
application/json
{
  • "warnings": [
    ],
  • "response": {
    }
}

Monitor

get_metrics

Request Body schema: application/json

Request to traffic generator for metrics of choice

choice
string
Default: "port"
Enum: "port" "flow" "bgpv4" "bgpv6" "isis" "lag" "lacp" "lldp" "rsvp" "dhcpv4_client" "dhcpv4_server" "dhcpv6_client" "dhcpv6_server" "ospfv2" "convergence" "macsec" "mka" "ospfv3"
object (Port.Metrics.Request)

The port result request to the traffic generator

object (Flow.Metrics.Request)

The container for a flow metric request.

object (Bgpv4.Metrics.Request)

The request to retrieve BGPv4 per peer metrics/statistics.

object (Bgpv6.Metrics.Request)

The request to retrieve BGPv6 per peer metrics/statistics.

object (Isis.Metrics.Request)

The request to retrieve ISIS per Router metrics/statistics.

object (Lag.Metrics.Request)

The request to retrieve per LAG metrics/statistics.

object (Lacp.Metrics.Request)

The request to retrieve LACP per LAG member metrics/statistics.

object (Lldp.Metrics.Request)

The request to retrieve LLDP per instance metrics/statistics.

object (Rsvp.Metrics.Request)

The request to retrieve RSVP-TE per Router metrics/statistics.

object (Dhcpv4Client.Metrics.Request)

The request to retrieve DHCPv4 per client metrics/statistics.

object (Dhcpv4Server.Metrics.Request)

The request to retrieve DHCPv4 per Server metrics/statistics.

object (Dhcpv6Client.Metrics.Request)

The request to retrieve DHCPv6 per client metrics/statistics.

object (Dhcpv6Server.Metrics.Request)

The request to retrieve DHCPv6 per Server metrics/statistics.

object (Ospfv2.Metrics.Request)

The request to retrieve OSPFv2 per Router metrics/statistics.

object (Convergence.Request)

Under Review: Convergence metrics is currently under review for pending exploration on use cases.

Container for requesting control-plane and data-plane convergence time metrics for flows.

object (Macsec.Metrics.Request)

The request to retrieve MACsec per secure entity(secY) metrics/statistics.

object (Mka.Metrics.Request)

The request to retrieve MKA per peer metrics/statistics.

object (Ospfv3.Metrics.Request)

The request to retrieve OSPFv3 per router metrics/statistics.

Responses

Request samples

Content type
application/json
{
  • "choice": "port",
  • "port": {
    },
  • "flow": {
    },
  • "bgpv4": {
    },
  • "bgpv6": {
    },
  • "isis": {
    },
  • "lag": {
    },
  • "lacp": {
    },
  • "lldp": {
    },
  • "rsvp": {
    },
  • "dhcpv4_client": {
    },
  • "dhcpv4_server": {
    },
  • "dhcpv6_client": {
    },
  • "dhcpv6_server": {
    },
  • "ospfv2": {
    },
  • "convergence": {
    },
  • "macsec": {
    },
  • "mka": {
    },
  • "ospfv3": {
    }
}

Response samples

Content type
application/json
{
  • "choice": "port_metrics",
  • "port_metrics": [
    ],
  • "flow_metrics": [
    ],
  • "bgpv4_metrics": [
    ],
  • "bgpv6_metrics": [
    ],
  • "isis_metrics": [
    ],
  • "lag_metrics": [
    ],
  • "lacp_metrics": [
    ],
  • "lldp_metrics": [
    ],
  • "rsvp_metrics": [
    ],
  • "dhcpv4client_metrics": [
    ],
  • "dhcpv4server_metrics": [
    ],
  • "dhcpv6client_metrics": [
    ],
  • "dhcpv6server_metrics": [
    ],
  • "ospfv2_metrics": [
    ],
  • "convergence_metrics": [
    ],
  • "macsec_metrics": [
    ],
  • "mka_metrics": [
    ],
  • "ospfv3_metrics": [
    ]
}

get_states

Request Body schema: application/json

Request to traffic generator for states of choice

choice
string
Default: "ipv4_neighbors"
Enum: "ipv4_neighbors" "ipv6_neighbors" "bgp_prefixes" "isis_lsps" "lldp_neighbors" "rsvp_lsps" "dhcpv4_interfaces" "dhcpv4_leases" "dhcpv6_interfaces" "dhcpv6_leases" "ospfv2_lsas" "ospfv3_lsas"
object (Neighborsv4.States.Request)

The request to retrieve IPv4 Neighbor state (ARP cache entries) of a network interface(s).

object (Neighborsv6.States.Request)

The request to retrieve IPv6 Neighbor state (NDISC cache entries) of a network interface(s).

object (BgpPrefix.State.Request)

The request to retrieve BGP peer prefix information.

object (IsisLsps.State.Request)

The request to retrieve ISIS Link State PDU (LSP) information learned by the router.

object (LldpNeighbors.State.Request)

The request to retrieve LLDP neighbor information for a given instance.

object (RsvpLsps.State.Request)

The request to retrieve RSVP Label Switched Path (LSP) information learned by the router.

object (Dhcpv4Interface.State.Request)

The request for assigned IPv4 address information associated with DHCP Client sessions.

object (Dhcpv4Lease.State.Request)

The request to retrieve DHCP Server host allocated status.

object (Dhcpv6Interface.State.Request)

The request for assigned IPv6 address information associated with DHCP Client sessions.

object (Dhcpv6Lease.State.Request)

The request to retrieve DHCP Server host allocated status.

object (Ospfv2Lsas.State.Request)

The request to retrieve OSPFv2 Link State Advertisements (LSA) information learned by the routers.

object (Ospfv3Lsas.State.Request)

The request to retrieve OSPFv3 Link State Advertisements (LSA) information learned by the routers.

Responses

Request samples

Content type
application/json
{
  • "choice": "ipv4_neighbors",
  • "ipv4_neighbors": {
    },
  • "ipv6_neighbors": {
    },
  • "bgp_prefixes": {
    },
  • "isis_lsps": {
    },
  • "lldp_neighbors": {
    },
  • "rsvp_lsps": {
    },
  • "dhcpv4_interfaces": {
    },
  • "dhcpv4_leases": {
    },
  • "dhcpv6_interfaces": {
    },
  • "dhcpv6_leases": {
    },
  • "ospfv2_lsas": {
    },
  • "ospfv3_lsas": {
    }
}

Response samples

Content type
application/json
{
  • "choice": "ipv4_neighbors",
  • "ipv4_neighbors": [
    ],
  • "ipv6_neighbors": [
    ],
  • "bgp_prefixes": [
    ],
  • "isis_lsps": [
    ],
  • "lldp_neighbors": [
    ],
  • "rsvp_lsps": [
    ],
  • "dhcpv4_interfaces": [
    ],
  • "dhcpv4_leases": [
    ],
  • "dhcpv6_interfaces": [
    ],
  • "dhcpv6_leases": [
    ],
  • "ospfv2_lsas": [
    ],
  • "ospfv3_lsas": [
    ]
}

get_capture

Request Body schema: application/json

Capture results request to the traffic generator.

port_name
required
string

The name of a port a capture is started on.

x-constraint:

  • /components/schemas/Port/properties/name

Responses

Request samples

Content type
application/json
{
  • "port_name": "string"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "kind": "validation",
  • "errors": [
    ]
}

Capabilities

get_version

Responses

Response samples

Content type
application/json
{
  • "api_spec_version": "",
  • "sdk_version": "",
  • "app_version": ""
}